[CHIA-3769] - Update GMP to 6.3.0 and include new patch files#270
Merged
Conversation
Update compat.patch for compatibility changes
|
'This PR has been flagged as stale due to no activity for over 60 |
Member
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
enable-fatoption for GMP results in binaries in linux that do not work correctly on pre-Haswell CPUs that do not have the BMI2 instruction set.see original report here:
https://gmplib.org/list-archives/gmp-bugs/2021-January/004991.html
and newer (same bug) on 6.3.0 here:
https://gmplib.org/list-archives/gmp-bugs/2025-February/005562.html
This PR applies the same patch as the 6.2.1 files (
src/lib/gmp-patch-6.2.1/compat.candsrc/lib/gmp-patch-6.2.1/longlong.h- although it does so as a true patch file created withdiff -ufrom the original 6.2.1 checked in files. The patch does apply cleanly in 6.3.0The patch for
mpz/inp_raw.cis no longer needed as the 6.3.0 source include the exact same fixed codeThe wheel python tests were tested successfully on a Core 2 Duo P8600 that does not have the BMI2 instruction set.
Note
Medium Risk
Changes the native dependency build/patching flow and low-level GMP asm dispatch, which can affect wheel compatibility or performance across CPU variants.
Overview
Updates the Linux
cibuildwheelbuild step to download/build GMP6.3.0and apply a checked-in patch (src/lib/gmp-6.3.0.diff) instead of copying patched source files for6.2.1.Adds unified diff patch files for GMP
6.2.1and6.3.0that gate use of BMI1/BMI2/LZCNT instructions behind runtime CPUID checks (avoiding illegal instructions on older x86_64 CPUs), and removes the vendoredsrc/lib/gmp-patch-6.2.1/*sources (including the no-longer-neededmpz/inp_raw.cfix).Written by Cursor Bugbot for commit 0ceeeb9. This will update automatically on new commits. Configure here.